<template>
  <el-card
    class="box-card inspection-container"
    body-style="height:100%;box-sizing:border-box"
  >
    <notification :exams="exams" :to="'/read-over'"></notification>
  </el-card>
</template>

<script>
import Notification from "@/components/Notification.vue";
export default {
  name: "Inspection",
  components: { Notification },
  data() {
    return {
      tempsheet: [{ id: "001", topic: "123", studentAnswer: "123" }],
      radio: null,
      exams: [
        {
          exam_id: "1",
          title: "第一次考试",
          status: 0,
          type: "考试",
          deadline: "2023年2月6日16:30:47",
        },
        {
          exam_id: "2",
          title: "第二次考试",
          status: 1,
          type: "考试",
          deadline: "2023年2月6日16:30:47",
        },
        {
          exam_id: "3",
          title: "第三次考试",
          status: 1,
          type: "考试",
          deadline: "2023年2月6日16:30:47",
        },
      ],
    };
  },
  methods: {
    gotoExamDetail() {
      console.log(`稍等，正在请求考试`);
      // 有结果了，带着请求结果进行跳转
      this.$router.push("/read-over");
    },
  },
  created() {
    const { teacher_id } = JSON.parse(localStorage.getItem("userInfo"));
    this.axios
      .get(`${this.$reqPrefix}/getEvaluation?teacher_id=${teacher_id}`)
      .then((res) => {
        // console.log(res)
        if (res.data.code == 200) {
          this.exams = res.data.data;
        }
      });
  },
};
</script>

<style lang='less' scoped>
.el-card {
  border: none;
  height: 100%;
}
</style>